﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.CMS263.PO;

namespace Com.CMS263.DAO
{
    public class CommentResultDAO : BaseService
    {
        public IList<CommentResult> GetListPaging(int ComId)
        {
            string hql = "from CommentResult where 1=1";
            hql += " and ComId = " + ComId;
            hql += " order By AddDate Desc";
            return FindList<CommentResult>(hql, null, null, null);
        }
        public CommentResult GetComm(int ComId)
        {
            string hql = "from CommentResult where 1=1";
            hql += " and ComId = " + ComId;
            hql += " order By AddDate Desc";
            try
            {
                return FindList<CommentResult>(hql, null, null, null).First();
            }
            catch (Exception)
            {

                return null;
            }

        }
    }
}
